<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户注册</title>
<style type="text/css">
	.register{
	text-align: center;
	font-size: 26px;
	font-weight: bolder;
	margin-top: 80px
	}
	#form1{
	width: 100% ;
	height: 100%;
	/* background-color: #e6e6e6; */
	text-align: center;
	font-size: 24px;
	margin-top: 20px;
	}
	.name{
	text-align: center;
	}
	#userName{
	width: 300px;
	height: 25px;
	font-size: 10px;
	}
	#hint{
	color:#F00;
	}
	.pwd{
	text-align: center;
	}
	#password{
	width: 300px;
	height: 25px;
	font-size: 10px;
	}
	.conpwd{
	text-align: center;
	}
	#confirmPwd{
	width: 300px;
	height: 25px;
	font-size: 10px;
	}
	.submit{
	width: 130px;
	height: 35px;
	background-color: #0061b0;
	color: #ffffff;
	font-size: 24px;
	}
</style>
<script type="text/javascript">
	function CheckUser(){
		var userID=document.getElementById("userName").value;
		var pwd=document.getElementById("password").value;
		var conpwd=document.getElementById("confirmPwd").value;
		if(userID.length>0 && pwd.length>0 && conpwd.length >0){
			if(pwd == conpwd){
			return true;
			}
			else{
				alert("两次输入的密码不一致，请重新输入");
				document.getElementById("password").value="";
				document.getElementById("confirmPwd").value="";
				return false;
			}
		}
		else{
			
			if(userID.length<=0 || pwd.length<=0 || conpwd.length<0){
				alert("用户名或密码不能为空");
				document.getElementById("userName").value="";
				document.getElementById("password").value="";
				document.getElementById("confirmPwd").value="";
			}
			
			return false;
		}
		
		return true;
	}
</script>
</head>
<body>
	<div class="register">请输入注册信息</div>
	<form action="RegisterInfo.jsp" id="form1" method="post" onsubmit="return CheckUser()">
		
		<div class="name">用户名：<input type="text" name="userName" id="userName"><span id="hint">*</span></div><br>
		<div class="pwd">密　码：<input type="password" name="password" id="password"><span id="hint">*</span></div><br>
		<div class="conpwd">确认密码：<input type="password" name="confirmPwd" id="confirmPwd"><span id="hint">*</span></div><br>
		<div>信息来源：
			<input type="checkbox" name="info" id="info" value="报刊">报刊
			<input type="checkbox" name="info" id="info" value="网络">网络
			<input type="checkbox" name="info" id="info" value="朋友推荐">朋友推荐
			<input type="checkbox" name="info" id="info" value="电视">电视
		</div><br>
		<div ><input type="submit" value="提交" class="submit"></div>
	</form>
</body>
</html>